/*

Input:  newdata/estimation_prep_ltw18_voter [prepared address-level panel]
 
Output: Figure D.7

Tasks: Produce maps

*/

* PLOT: FIGURE D7. Spatial Distribution of Polling Place Reassignments (Event = 100% reassignment)
forvalues j= 1/8 {	
		use "$newdata/estimation_prep_ltw18.dta", clear
	
		keep if wahl_id==`j'
		
		replace fulltreat_simple= 0 if smpl_trim !=1
		
		merge 1:n sb_new using "$newdata/ltw18_sb_mapping.dta", assert(3) nogen
	
	 spmap fulltreat_simple  using "$shp_path/landtagwahl2018_stimmbezirke_newprj_shp.dta", ///
	id(_ID) clmethod(unique) fcol(none cranberry%60 )  ///
	osize(vthin ..) ocol(black%20) ndsize(vvthin) ndfcolor(black%3) name(w`j', replace) ///
	polygon(data("$shp_path/stadtbezirke_shp.dta") ocol(black ..) osize(*1 ..)) ysize(3) ///
	legend(order( 3 "= Polling place relocation (event)") size(medsmall))
	
}
	grc1leg w1 w3  w5 w6 w7 w8, col(2)
	gr_edit .plotregion1.graph1.title.text.Arrpush "State Election 2013"
	gr_edit .plotregion1.graph2.title.text.Arrpush "Municipal Election 2014"
	gr_edit .plotregion1.graph3.title.text.Arrpush "Federal Election 2017"
	gr_edit .plotregion1.graph4.title.text.Arrpush "State Election 2018"	
	gr_edit .plotregion1.graph5.title.text.Arrpush "European Election 2019"
	gr_edit .plotregion1.graph6.title.text.Arrpush "Municipal Election 2020"	
	
	graph export "$figures/Figure_D7_map_treatment_timing.pdf", replace
	
	

	

	